<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>药品信息</title>
    <style type="text/css">
        td{
            height: 25px;
            width: 100px;
            border: #3a8ee6 1px solid;

        }
        input{
            height: 21px;
        }
    </style>
    <script type="text/javascript" src="../../js/jquery-1.11.0.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script type="text/javascript" src="../../js/01/daoru/druge/find.js"></script>
    <script type="text/javascript" src="../../js/fenye/fenye.js"></script>
    <script type="text/javascript" src="../../js/fenye/cengci.js"></script>
    <script type="text/javascript" src="../../js/01/daoru/druge/findOne.js"></script>
    <script type="text/javascript" src="../../js/fenye/leibie.js"></script>

    <script type="text/javascript">
        $(function () {
            gets(1)
            //查询所有供应商
            $.ajax({
                url:"/myspringboot/suppliser/selectAll",
                data:"",
                type:"post",
                dataType:"json",
                success:function(result){
                    console.log(result);
                    var result = result.data;
                    var opts = "";
                    for (var i = 0; i < result.length; i++) {
                        var surId = result[i].surId;
                        var surName = result[i].surName;
                        var opt = '<option value="'+surId+'">'+surName+'</option>';
                        opts += opt;
                    }
                    $(".d").append(opts);
                }
            })
        })

        //全选/全不选操作
        function setAllNo(){
            var box = document.getElementById("aaa");
            var choose = document.getElementsByName("choose");
            if(box.checked == false){
                for (var i = 0; i < choose.length; i++) {
                    choose[i].checked = false;
                }
            }else{
                for (var i = 0; i < choose.length; i++) {
                    choose[i].checked = true;
                }
            }
        }

        function submit1() {
            var an = [];
            var shenhe1 = [];
            console.log(an)
            console.log(shenhe1)
            var shenhe=$("select[name='shenhe']");
            var box = document.getElementsByClassName("selectItem1");
            for ( boxKey in box) {
                if (box[boxKey].checked){
                    shenhe1.push(shenhe[boxKey].value)
                    an.push(box[boxKey].value)
                }
            }
            $.ajax({
                url: '/myspringboot/SdiDiInfController/updateSubmit',
                type: 'POST',
                dataType: "json",
                traditional: true,
                data:{
                    sdiState:shenhe1,
                    sdiId:an,
                },
                success:function (result) {
                    alert(result.msg)
                    window.location.href="drug04.html"
                }
            })
        }
    </script>
</head>
<body>
<div>
    <table class="" style="border: 1px solid #999;border-collapse:collapse">
        <tr>
            <h3 style="height: 50px" >供货管理</h3>
        </tr>
        <tr>
            <td>药品流水号：</td>
            <td><input id="dinumber" name="dinumber" type="text" value=""></td>
            <td></td>
            <td>通用名：</td>
            <td><input id="cname" name="cname" type="text" value=""></td>
            <td></td>
        </tr>
        <tr>
            <td>剂型：</td>
            <td><input id="jixing" name="jixing" type="text" value=""></td>
            <td></td>
            <td>规格：</td>
            <td><input id="guige" name="guige" type="text" value=""></td>
            <td></td>
        </tr>
        <tr>
            <td>单位：</td>
            <td><input id="danwei" name="danwei" type="text" value=""></td>
            <td></td>
            <td>转换系数：</td>
            <td><input id="cc" name="cc" type="text" value=""></td>
            <td></td>
        </tr>
        <tr>
            <td>生产企业：</td>
            <td><input name="qiye" id="qiye" type="text" value=""></td>
            <td></td>
            <td>商品名：</td>
            <td><input name="shangpin" id="shangpin" type="text" value=""></td>
            <td></td>
        </tr>
        <tr>
            <td>价格范围：</td>
            <td><input id="lefPprice" style="width: 65px" type="text" value="">至<input id="rightPrice" style="width: 65px" type="text" value=""></td>
            <td></td>
            <td>质量层次：</td>
            <td>
                <select id="cengci" style=" height: 25px; width: 160px;">
                    <option value="">全部</option>
                </select>
            </td>
            <td></td>
        </tr>
        <tr>
            <td>药品类别：</td>
            <td>
                <select id="dcid" style=" height: 25px; width: 160px;">
                    <option value="">请选择</option>
                </select>
            </td>
            <td></td>
            <td style="width: 120px">药品交易状态:</td>
            <td>
                <select id="state" name="state" style=" height: 25px; width: 160px;">
                    <option value="">全部</option>
                    <option value="">正常</option>
                    <option value="">不正常</option>
                </select>
            </td>
            <td></td>
        <tr>
            <td>供应商</td>
            <td>
                <select class="d" style=" height: 25px; width: 160px;">
                    <option value="">全部</option>
                </select>
            </td>
            <td></td>
            <td>审核状态</td>
            <td>
                <select name="" style=" height: 25px; width: 160px;">
                    <option value="">全部</option>
                    <option value="0">审核通过</option>
                    <option value="1">审核不通过</option>
                </select>
            </td>
            <td></td>
        </tr>
        </tr>
    </table>
    <td>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <button type="reset" onclick="gets()">查询</button>
    </td><br>
    <td><button onclick="submit1()">提交审核结果</button></td>
    <table>
        <tr>
            <td>序号</td>
            <td><input type="checkbox" id="aaa" onclick="setAllNo()">选择供货</td>
            <td>审核结果</td>
            <td>供货商</td>
            <td>药品流水号</td>
            <td>通用名</td>
            <td>剂型</td>
            <td>规格</td>
            <td>单位</td>
            <td>转换系数</td>
            <td>生产企业</td>
            <td>商品名称</td>
            <td>中标价</td>
            <td>质量层次</td>
            <td>药品类别</td>
            <td>交易状态</td>
        </tr>
        <tbody class="a">
        </tbody>
    </table>

</div>
<div class="im-page" id="impage">
    <tr>
        <td><button id='first'>首页</button></td>
        <td><button id='before'>上一页</button></td>
        <td>第<span id="pnum"></span>页</td>
        <td>共<span id="ptotal"></span>页</td>
        <td><button  id='next'>下一页</button></td>
        <td><button id='last'>尾页</button></td>
    </tr>
</div>
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    药品目录详细
                </h4>
            </div>
            <form id="csid">
                <div class="modal22">

                </div>
            </form>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary">
                    更改
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
</body>
</html>
